<script setup>
import { memberOrderId } from '@/api/order'
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import Countdown from '../components/Countdown.vue'
const route = useRoute()
const data = ref()
const getData = async () => {
  const res = await memberOrderId(route.params.id)
  data.value = res.data.result
}
getData()
const bankData = ['招商银行', '工商银行', '建设银行', '农业银行', '交通银行']
</script>
<template>
  <div class="pay-page" v-if="data">
    <div class="top">
      <div class="lef">
        <el-icon class="icon"><SuccessFilled /> </el-icon>
        <div>
          <div class="tet" style="font-size: 20px">订单提交成功！请尽快完成支付。</div>
          <div class="tet" style="color: grey">
            支付还剩<Countdown :countdown="data.countdown"></Countdown>，超时后将取消订单
          </div>
        </div>
      </div>
      <div class="right">
        应付总额：<span style="color: red; font-size: 20px">￥{{ data.payMoney }}</span>
      </div>
    </div>
    <div class="but">
      <div class="but-header">请选择以下支付方式付款</div>
      <div class="payPl">
        <div class="title">支付平台</div>
        <div class="item">微信支付</div>
        <div class="item">支付宝</div>
      </div>
      <div class="payType">
        <div class="title">支付方式</div>
        <div v-for="item in bankData" :key="item" class="item">{{ item }}</div>
      </div>
    </div>
  </div>
</template>
<style scoped lang="scss">
.pay-page {
  width: 100%;
  padding: 40px 0;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  .top {
    display: flex;
    padding: 80px;
    box-sizing: border-box;
    width: 1250px;
    height: 250px;
    margin: 0 auto;
    background-color: #fff;
    line-height: 90px;

    .lef {
      display: flex;
      flex: 1;
      .icon {
        color: #1dc779;
        font-size: 70px;
        position: relative;
        bottom: -10px;
      }
      .tet {
        position: relative;
        bottom: 12px;
        height: 30px;
      }
    }
    .right {
      color: grey;
    }
  }
  .but {
    .but-header {
      padding: 30px 30px;
      border-bottom: 1px solid #f5f5f5;
    }
    .payPl {
      padding: 20px 30px;
    }
    .item {
      margin: 20px 0;
      margin-right: 20px;

      display: inline-block;
      width: 150px;
      height: 50px;
      border: 1px solid #f5f5f5;
      text-align: center;
      line-height: 50px;
      &:hover {
        border: 1px solid #1dc779;
      }
    }
    .payType {
      padding: 20px 30px;
    }
    width: 1250px;
    margin: 0 auto;

    background-color: #fff;
    margin-top: 50px;
  }
}
</style>
